<template>
  <view class="page">
    <view class="banner">
      <swiper class="swiper">
				<swiper-item class="swiper__item">
          <image
            class="swiper__img"
            src="https://img13.360buyimg.com/n1/jfs/t1/139891/37/34212/150224/6411271dF34f07316/33e41085a66c5026.jpg.avif"
          />
				</swiper-item>
        <swiper-item class="swiper__item">
          <image
            class="swiper__img"
            src="https://img13.360buyimg.com/n1/jfs/t1/5902/15/19105/154898/641125c7F57601e55/e84c0c4b99307ca7.jpg.avif"
          />
				</swiper-item>
        <swiper-item class="swiper__item">
          <image
            class="swiper__img"
            src="https://img13.360buyimg.com/n1/jfs/t1/50653/28/24057/109848/641047b2F6ed1324c/b98384b357a12cf1.jpg.avif"
          />
				</swiper-item>
			</swiper>
    </view>
    <view class="content">
      <view class="info">
        <view class="info__price">
          <text>￥</text>
          <text class="big">1988</text>
          <text>.00</text>
        </view>
        <view class="info__name">硕加 戏台式机电脑主机整机全套组装机 高效办公—》酷睿i5高频强芯丨8G 120G 单主机</view>
      </view>
      <view class="sku">
        <view class="text">
          <text>选择</text>
          <text class="value">颜色，大小</text>
        </view>
        <image class="sku__arrow" src="~@/static/my/arrow.png" />
      </view>
      <view class="goods">
        <view class="goods__head">
          <image class="goods__icon" src="~@/static/shop/goodsIcon.png" />
          <text>商品详情</text>
        </view>
        <view class="goods__cont">
          <image mode="widthFix" src="https://img10.360buyimg.com/imgzone/jfs/t1/19421/31/12709/74396/6412be74F35bc7b85/4114f3f2345bc942.jpg.avif" />
          <image mode="widthFix" src="https://img10.360buyimg.com/imgzone/jfs/t1/219782/5/26475/102675/64128776Ff1e59701/ddb987cdf43b02c1.jpg.avif" />
          <image mode="widthFix" src="https://img13.360buyimg.com/cms/jfs/t1/47311/39/24737/144717/6412c850F2780aee8/cea112d74a53be20.gif" />
        </view>
      </view>
    </view>
    <view class="fixed-btm">
      <view @tap="car" class="red">加入购物车</view>
      <view @tap="buy">立即购买</view>
    </view>
    <GoodsSku ref="GoodsSku" />
  </view>
</template>

<script>
import GoodsSku from '@/components/GoodsSku/GoodsSku.vue';

export default {
  components: { GoodsSku },
  data() {
    return {

    }
  },
  methods: {
    car() {
      this.$refs.GoodsSku.open();
    },
    buy() {
      uni.navigateTo({
        url: '/subpages/shop/orderConfirm/orderConfirm'
      })
    }
  }
}
</script>

<style lang="scss">
.page {
  box-sizing: border-box;
  padding-bottom: calc(88rpx);
  padding-bottom: calc(88rpx + constant(safe-area-inset-bottom));
  padding-bottom: calc(88rpx + env(safe-area-inset-bottom));
}
.banner {
  width: 100%;
  height: 750rpx;
}
.swiper, .swiper__img {
  width: 100%;
  height: 100%;
}
.content {
  box-sizing: border-box;
  padding: 20rpx 20rpx 0 20rpx;
}
.info {
  width: 100%;
  box-sizing: border-box;
  padding: 20rpx;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 20rpx;
}
.info__price {
  display: flex;
  align-items: baseline;
  color: #FF2323;
  font-size: 28rpx;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 12rpx;
  .big {
    font-size: 42rpx;
  }
}
.info__name {
  color: #333;
  line-height: 1.5;
  font-weight: bold;
  font-size: 28rpx;
}
.sku {
  width: 100%;
  box-sizing: border-box;
  padding: 0 0 0 28rpx;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 20rpx;
  font-size: 24rpx;
  color: #8E8E8E;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .text {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 10rpx 0;
  }
  .value {
    color: #333333;
    margin-left: 32rpx;
    flex: 1;
  }
}
.sku__arrow {
  min-width: 88rpx;
  width: 88rpx;
  height: 88rpx;
}
.goods {
  width: 100%;
  background-color: #fff;
  border-radius: 10rpx;
  margin-bottom: 20rpx;
  overflow: hidden;
  border-radius: 10rpx;
}
.goods__head {
  display: flex;
  align-items: center;
  height: 88rpx;
  color: #333;
  font-size: 26rpx;
  box-sizing: border-box;
  padding: 26rpx;
}
.goods__icon {
  width: 30rpx;
  height: 30rpx;
  margin-right: 16rpx;
}
.goods__cont {
  overflow: hidden;
  box-sizing: border-box;
  image, img {
    width: 100%;
  }
}
.fixed-btm {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 100;
  width: 100%;
  box-sizing: content-box;
  background-color: #fff;
  padding-bottom: 0px;
  padding-bottom: calc(0px + constant(safe-area-inset-bottom));
  padding-bottom: calc(0px + env(safe-area-inset-bottom));
  display: flex;
  > view {
    flex: 1;
    height: 88rpx;
    background-color: #FBBF0D;
    color: #fff;
    font-size: 30rpx;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    &.red {
      background-color: #FB740D;
    }
  }
}
</style>
